package com.beichuan_travel.model.abstracts;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Food {

    @NotBlank(message = "美食名不能为空")
    @Length(max = 15, message = "名字的最长长度为15")
    @ApiModelProperty(value = "美食名字", allowEmptyValue = false)
    private String name;

    @NotNull(message = "价格不能为空")
    @ApiModelProperty(value = "美食价格", allowEmptyValue = false)
    private Float price;

    @NotNull(message = "星级不能为空")
    @Digits(integer = 1, fraction = 5, message = "星级只能在1-5之间")
    @ApiModelProperty(value = "美食星级", allowEmptyValue = false)
    private Float star;


    @Length(max = 100)
    @ApiModelProperty(value = "美食描述", allowEmptyValue = true)
    private String description;
}
